﻿namespace RulesEngine
{
    public class NotRule<TCandidate> : CompositeRule<TCandidate>
    {
        public IRule<TCandidate> Wrapped;

        public NotRule(IRule<TCandidate> x)
        {
            Wrapped = x;
        }

        public override bool Execute(TCandidate candidate)
        {
            return !Wrapped.Execute(candidate);
        }
    }
}